package com.yunxi.common.config;

import com.alibaba.fastjson.JSONObject;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.stereotype.Component;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by Administrator on 2019/9/8.
 */
@Component
public class EAISwitchConfig implements ApplicationListener<ContextRefreshedEvent> {

    @Autowired
    private RedisCacheService rcs;
    @Override
    public void onApplicationEvent(ContextRefreshedEvent contextRefreshedEvent) {
        String EAISwitch=getEaiSwitch();
        rcs.set("EAISwitch",EAISwitch);
        Object object = rcs.get("EAISwitch");
        System.out.println(object);
    }

    public String getEaiSwitch() {
        Map map=new HashMap();
        /*map.put("PMS系统发送派单数据给AIEG系统-AIGE006001A","true");
        map.put("PMS系统发送充电桩退订给AIEG系统-AIGE006002A","true");
        map.put("PMS系统发送小订审核数据给APP系统-S0250001A","true");
        map.put("PMS系统发送车辆状态数据给APP系统-S0250009A","true");
        map.put("PMS系统发送选装包价格给APP系统(新增)-S0250002A","true");
        map.put("PMS系统发送选装包价格给APP系统(修改)-S0250003A","true");
        map.put("PMS系统发送内外饰颜色配置给APP系统(新增)-S0250006A","true");
        map.put("PMS系统发送内外饰颜色配置给APP系统(修改)-S0250007A","true");
        map.put("PMS系统发送车型价格给APP系统(新增)-S0250004A","true");
        map.put("PMS系统发送车型价格给APP系统(修改)-S0250005A","true");

        map.put("PMS系统发送组织信息数据给IAM系统-S0100001A","true");
        map.put("PMS系统发送人员信息数据给IAM系统-S0100008A","true");

        map.put("PMS系统发送渠道主数据给SAP系统-S0000008B","true");
        map.put("PMS系统发送价格试算数据给SAP系统-S0030032A","true");
        map.put("PMS系统发送批售单给SAP系统-S0030028A","true");
        map.put("PMS获取SAP系统渠道资金-S0030033A","true");
        map.put("PMS获取SAP系统渠道资金明细-S0030034A","true");
        map.put("PMS系统发送借贷项请求信息给SAP系统-S0030037A","true");
        map.put("PMS系统发送返利发放金额同步信息给SAP系统-S0030036A","true");
        map.put("PMS系统发送整车批售订单修改信息给SAP系统-S0030035A","true");
        map.put("PMS系统发送交货单过账信息给SAP系统-S0000014B","true");
        map.put("PMS系统发送整车VDC入库信息给SAP系统-S0000013B","true");
        map.put("PMS系统发送整车库存同步信息给SAP系统-S0030031A","true");
        map.put("PMS系统发送车辆出入库信息给TSP系统-S0000016B","true");
        map.put("PMS系统发送车辆实销信息给TSP系统-S0000015B","true");
        map.put("PMS系统发送车辆过户信息给TSP系统-S0140005A","true");
        map.put("PMS系统发送发运单审核信息给TMS系统-S0300002A","true");
        map.put("PMS系统发送可发资源信息给TMS系统-S0300001A","true");
        map.put("UPS维修系统发送服务活动信息给UPS工单系统-S0310017A","true");
        map.put("UPS维修系统发送预授权申请单给UPS工单系统-S0310018A","true");
        map.put("PMS系统发送客户信息给URM系统(新增)-S0280001A","true");
        map.put("PMS系统发送客户信息给URM系统(修改)-S0280002A","true");
        map.put("PMS系统通过手机号获取用户信息-S0280003A","true");
        map.put("PMS系统发送跟进数据给URM-S0280004A","true");
        map.put("PMS系统发送意向信息给URM-S0280005A","true");
        map.put("PMS系统发送订单信息给URM-S0280007A","true");
        map.put("PMS系统发送试乘试驾信息给URM-S0280006A","true");
        map.put("PMS系统发送交车信息给URM-S0280008A","true");*/
        map.put("AIGE006001A","true");
        map.put("AIGE006002A","true");
        map.put("S0250001A","true");
        map.put("S0250009A","true");
        map.put("S0250002A","true");
        map.put("S0250003A","true");
        map.put("S0250006A","true");
        map.put("S0250007A","true");
        map.put("S0250004A","true");
        map.put("S0250005A","true");

        map.put("S0100001A","true");
        map.put("S0100008A","true");

        map.put("S0000008B","true");
        map.put("S0030032A","true");
        map.put("S0030028A","true");
        map.put("S0030033A","true");
        map.put("S0030034A","true");
        map.put("S0030037A","true");
        map.put("S0030036A","true");
        map.put("S0030035A","true");
        map.put("S0000014B","true");
        map.put("S0000013B","true");
        map.put("S0030031A","true");
        map.put("S0000016B","true");
        map.put("S0000015B","true");
        map.put("S0140005A","true");
        map.put("S0300002A","true");
        map.put("S0300001A","true");
        map.put("S0310017A","true");
        map.put("S0310018A","true");
        map.put("S0280001A","true");
        map.put("S0280002A","true");
        map.put("S0280003A","true");
        map.put("S0280004A","true");
        map.put("S0280005A","true");
        map.put("S0280007A","true");
        map.put("S0280006A","true");
        map.put("S0280008A","true");
        String eaiSwitch= JSONObject.toJSONString(map);
        return eaiSwitch;
    }
}
